<html>
    <body onload="init()">
        <script type="text/javascript" src="jquery-1.3.1.min.js">
        </script>
        <script type="text/javascript" src="jquery-mvc.js">
        </script>
        <script type="text/javascript">
            function Person(){
            };
            Person.prototype = {
                setName: function(name){
                    this.name = name;
                },
                getName: function(){
                    return this.name;
                },
                setMother: function(mother){
                    this.mother = mother;
                },
                getMother: function(){
                    return this.mother;
                }
            };
			var shira = new Person();
			var mom = new Person();
			function init() {
				
				mom.setName("逋ｽ遏ｳ驕灘ｭ�");
				shira.setName("逋ｽ遏ｳ菫雁ｹｳ");
				shira.setMother(mom);
				
				console.log(getNestedProperty(window, "shira.mother.name"));
				setNestedProperty(window, "shira.mother.name", "縺励ｉ縺�縺励∩縺｡縺�");
				console.log(shira.getMother().getName());
				
				addPropertyChangeListener(shira, "name", function(oldValue, newValue){
					alert("oldValue:" + oldValue + " newValue:" + newValue);
				});
				addNestedPropertyChangeListener(shira, "mother.name", function(oldValue, newValue){
					alert("Nested:oldValue:" + oldValue + " newValue:" + newValue);
				})
				shira.setName("縺励ｉ縺�縺励＠繧�繧薙⊆縺�");
				shira.getMother().setName("逋ｽ遏ｳ縺ｿ縺｡縺�");
				mom = new Person();
				mom.setName("縺ｪ縺ｪ縺励�ｮ繧ｴ繝ｳ繧ｳ");
				shira.setMother(mom);
				
				$(".output").bindProperty("innerHTML", "mother.name", shira);
				shira.getMother().setName("繧ｷ繝ｩ繧､繧ｷ繝溘メ繧ｳ");
				mom = new Person();
				mom.setName("");
				shira.setMother(mom);
				/*
				binder(shira, "name", document.getElementById("output"), "innerHTML");
				shira.setName("繧ｷ繝ｩ繧､繧ｷ繧ｷ繝･繝ｳ繝壹う");
				binder(shira, "mother.name", document.getElementById("output2"), "innerHTML");
				shira.getMother().setName("繧ｷ繝ｩ繧､繧ｷ繝溘メ繧ｳ");

				mom = new Person();
				mom.setName("縺ｪ縺ｪ縺励�ｮ繧ｴ繝ｳ繧ｳ");
				shira.setMother(mom);
				*/
			}
      </script>
		<span id="output" class="output"></span>
		<span id="output2" class="output"></span>
    </body>
</html>
